package com.twu.biblioteca.controllers;

import com.twu.biblioteca.models.Option;

/**
 * Created with IntelliJ IDEA.
 * User: mmoise
 * Date: 14/05/2013
 * Time: 10:48
 * To change this template use File | Settings | File Templates.
 */
public class OptionController {

    private Option[] options = {};

    public OptionController(){
        Option option1 = new Option("1. Show all the books in the library","1");
        Option option2 = new Option("2. Reserve book","2");
        Option option3 = new Option("3. Check membership details","3");
        Option option4 = new Option("4. Show movie list","4");
        Option option5 = new Option("5. Log-in","5");
        Option option6 = new Option("6. Exit","6");
        Option[] _options = {option1, option2, option3, option4, option5, option6};
        options = _options;
    }

    public void setOptions(Option[] options){
        this.options = options;
    }

    public void showOptions(){
        for (int i=0;i<options.length;i++){
            System.out.println(options[i].name);
        }
    }

    public boolean verifyShortcut(String shortcut){
       boolean ok = false;
       for (int i=0;i<options.length;i++){
           if (options[i].shortcut.equals(shortcut)) ok = true;
       }
       return ok;
    }
}
